package ace.cmp.data.methodname.method.name.sql.core.enums;

import java.util.Arrays;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Caspar 逻辑操作符号
 */
@AllArgsConstructor
public enum RelationalOpEnum {
  AFTER("after", ">", Arrays.asList("After", "IsAfter")),
  BEFORE("before", "<", Arrays.asList("Before", "IsBefore")),
  CONTAINS("contains ", "like %query%", Arrays.asList("Contains", "Containing", "IsContaining")),
  BETWEEN("between", "between", Arrays.asList("Between", "IsBetween")),
  ENDING_WITH(
      "like_right",
      "like-right",
      Arrays.asList("EndingWith", "IsEndingWith", "EndsWith", "EndWith")),
  FALSE("is_false ", "is false", Arrays.asList("IsFalse", "False")),
  GREATER_THAN("gt ", "> GreaterThan", Arrays.asList("GreaterThan", "IsGreaterThan")),
  GREATER_THAN_EQUAL(
      "ge ", ">= GreaterThanEqual", Arrays.asList("GreaterThanEqual", "IsGreaterThanEqual")),
  IN("in ", "in", Arrays.asList("In", "IsIn")),
  EQUALS("equals", "==", Arrays.asList("", "Is", "Equals")),
  IS_EMPTY("is_empty ", "=''", Arrays.asList("IsEmpty", "Empty")),
  IS_NOT_EMPTY("is_not_empty", "!=''", Arrays.asList("IsNotEmpty", "NotEmpty")),
  IS_NOT_NULL("is_not_null", "is not null", Arrays.asList("IsNotNull", "NotNull")),
  IS_NULL("is_null", "is null", Arrays.asList("IsNull", "Null")),
  LESS_THAN("less_than", "<", Arrays.asList("LessThan", "IsLessThan")),
  LESS_THAN_EQUAL("less_than_equal", "<=", Arrays.asList("LessThanEqual", "IsLessThanEqual")),
  LIKE("like ", "like", Arrays.asList("like", "IsLike")),
  NOT("not", "!=", Arrays.asList("Not", "IsNot")),
  NOT_IN("not_in", "not in", Arrays.asList("NotIn", "IsNotIn")),
  NOT_LIKE("not_like", "not like ''", Arrays.asList("NotLike", "IsNotLike")),
  STARTING_WITH(
      "like_left", "like-left", Arrays.asList("StartingWith", "IsStartingWith", "StartsWith")),
  TURE("true", "true", Arrays.asList("True", "IsTrue")),
  ;
  @Getter private String code;
  @Getter private String desc;

  @Getter private List<String> keywords;
}
